package com.leyou.item.mapper;

import com.leyou.item.entity.Sku;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.additional.idlist.IdListMapper;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.special.InsertListMapper;

public interface SkuMapper extends Mapper<Sku>,InsertListMapper<Sku>,IdListMapper<Sku,Long>{


    @Update("update tb_sku set stock = stock - #{sum} where id = #{id}")
    int minusStock(@Param("id") Long id,@Param("sum") Integer sum);
}
